package com.bnyy.message.enums;

/**
 * Author : 关炳鹏
 * Description :
 * Date : 2022/12/10
 **/
public enum ChatMessageStatus {

    SENDING(0),
    SUCCESS(1),
    FAILURE(2);

    private int type;

    ChatMessageStatus(int sendStatus) {
        this.type = sendStatus;
    }

    public int getType() {
        return type;
    }

    public static ChatMessageStatus getSendStatus(int type) {
        ChatMessageStatus[] values = ChatMessageStatus.values();
        for (ChatMessageStatus sendStatus : values) {
            if (sendStatus.type == type) {
                return sendStatus;
            }
        }
        return null;
    }
}
